#pip install thop

import torch,time
import torchvision
from thop import profile

model = torchvision.models.alexnet(pretrained=False)
dummy_input = torch.randn(1, 3, 112, 112)
flops, params = profile(model, (dummy_input,))
print('flops: ', flops, 'params: ', params)
print('flops: %.2f M, params: %.2f M' % (flops / 1000000.0, params / 1000000.0))
